<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="index.js"></script>
<script>
    var foo = 'windowFoo'
    const obj = {
        foo: 'objFoo',
        getName: function (a, b) {
            console.log(this.foo, a, b)
        }
    }

    const obj2 = {
        foo: 'obj2Foo'
    }

    obj.getName(1, 2)               // objFoo 1, 2
    obj.getName.call(obj2, 1, 2)      // obj2Foo 1, 2
    obj.getName.call(null, 1, 2)      // windowFoo 1, 2
    obj.getName.call(undefined, 1, 2) // windowFoo 1, 2
    obj.getName.call(false, 1, 2)     // undefined 1, 2
</script>
</body>
</html>
